package design.patterns.creational.builder;



public class Computer {
    private String memory;
    private String hardDisk;
    private String cpu;
    private String mainBoard;

    public Computer(Builder builder) {
        this.memory = builder.getMemory();
        this.hardDisk = builder.getHardDisk();
        this.cpu = builder.getCpu();
        this.mainBoard = builder.getMainBoard();
    }

    @Override
    public String toString() {
        return "Computer{" +
                "memory='" + memory + '\'' +
                ", hardDisk='" + hardDisk + '\'' +
                ", cpu='" + cpu + '\'' +
                ", mainBoard='" + mainBoard + '\'' +
                '}';
    }

    public static class Builder{
         String memory;
         String hardDisk;
         String cpu;
         String mainBoard;

         public Builder buildMermory(String memory){
             this.memory = memory;
             return this;
         }
        public Builder buildHardDisk(String hardDisk){
            this.hardDisk = hardDisk;
            return this;
        }
        public Builder buildCpu(String cpu){
            this.cpu = cpu;
            return this;
        }
        public Builder buildMainBoard(String mainBoard){
            this.mainBoard = mainBoard;
            return this;
        }

        public Computer build(){
             return new Computer(this);
        }

        public String getMemory() {
            return memory;
        }

        public void setMemory(String memory) {
            this.memory = memory;
        }

        public String getHardDisk() {
            return hardDisk;
        }

        public void setHardDisk(String hardDisk) {
            this.hardDisk = hardDisk;
        }

        public String getCpu() {
            return cpu;
        }

        public void setCpu(String cpu) {
            this.cpu = cpu;
        }

        public String getMainBoard() {
            return mainBoard;
        }

        public void setMainBoard(String mainBoard) {
            this.mainBoard = mainBoard;
        }
    }



}
